package main

import (
	"github.com/iris-contrib/middleware/cors"
	"github.com/kataras/iris/v12"
	"github.com/sirlanri/qianfeng2/handlers"
)

func main() {
	app := iris.New()
	app.OnErrorCode(iris.StatusNotFound, handlers.NotFound)
	crs := cors.New(cors.Options{
		AllowedOrigins:   []string{"*.ri-co.cn"}, //允许通过的主机名称
		AllowCredentials: true,
	})

	qianfeng2 := app.Party("/qianfeng2", crs).AllowMethods(iris.MethodOptions)

	qianfeng2.Get("/")
}
